﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EvidenceManagement.Data.Common
{
    public class InvalidDataObjectException : Exception
    {
        #region Fields

        readonly object invalidDataObject;

        #endregion

        public InvalidDataObjectException()
        {
            invalidDataObject = null;
        }

        public InvalidDataObjectException(object invalidDataObject)
        {
            this.invalidDataObject = invalidDataObject;
        }

        public override string Message
        {
            get
            {
                if (invalidDataObject == null)
                    return "Invalid data object parsed to data repository.";
                else
                    return string.Format("Invalid data object '{0}' parsed to data repository.", invalidDataObject.GetType().FullName);       
            }
        }
    }
}
